﻿

// 自定义双击查看
var CustomDbClick = function () {
    var recordID = myDataTable.getSelectedRows()[0],
        record = myDataTable.getRecord(recordID);
    //alert(record.getData("ID"));
    const_EditEntity = "V_BH_BOM";
    var pagetitle = "查看物料清单—" + record.getData("BOMNo");
    parent._employeeTitle = pagetitle;
    parent.addTabs(pagetitle, "/Extend/AutoLoadForm.aspx?r=" + Math.random() + "&entity=" + const_EditEntity + "&read=true&id=" + record.getData("ID"));
}

// 自定义新增
var fnCustomAdd = function () {
    const_EditEntity = "V_BH_BOM";
    var pagetitle = "新增物料清单";
    parent._employeeTitle = pagetitle;
    parent.addTabs(pagetitle, encodeURI("../Extend/Edit.aspx?r=" + Math.random() + "&entity=" + const_EditEntity + "&actionFlag=1"));
    parent.NeedRefreshPage = this;
}

// 自定义修改
var fnCustomEdit = function () {
    var recordID = myDataTable.getSelectedRows()[0];
    record = myDataTable.getRecord(recordID);
    if (record == null) {
        alert("请选择一条记录");
        return;
    }
    const_EditEntity = "V_BH_BOM";
    var pagetitle = "修改物料清单—" + record.getData("BOMNo");
    parent._employeeTitle = pagetitle;
    parent.addTabs(pagetitle, encodeURI("../Extend/Edit.aspx?r=" + Math.random() + "&entity=" + const_EditEntity + "&id=" + record.getData(const_entityID) + "&actionFlag=2"));
    parent.NeedRefreshPage = this;
}

// 自定义删除
var fnCustomDelete = function () {
    alert("物料清单不允许删除!");
    return;
}
